package com.magalindo8.android;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.WindowManager;

import com.magalindo8.Adds;
import com.magalindo8.Estados;

public class MainActivity extends Activity {
	
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		Adds.context = this;
		Adds.iniciarInterstitial();
		getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
		
		Intent intent = new Intent(MainActivity.this, GameActivity.class);
		startActivityForResult(intent, Estados.GAME_ACTIVITY);
	}
	
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
//	    if (requestCode == Estados.GAME_ACTIVITY) {
//	    	if (Estados.RESTART) {
//	    		adds.displayInterstitial();
//	    	}else{
//	    		finish();
//	    	}
//	    }
		finish();
	}
	
//	public void restart(){
//		if (Estados.RESTART) {
//        	Intent intent = new Intent(MainActivity.this, MainActivity.class);
//    		startActivityForResult(intent, Estados.GAME_ACTIVITY);
//        }
//        finish();
//	}
	
	
}

